/*
 * @Description: 发布详情预览
 * @Author: iamsmiling
 * @Date: 2021-06-06 16:27:30
 * @LastEditTime: 2021-06-15 18:03:47
 */
import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/components/image/chimera_image.dart';
import 'package:flutter/material.dart';

import 'section/author_contact_card.dart';
import 'section/source_card.dart';
import 'section/source_demander_card.dart';
import 'section/source_description_card.dart';
import 'section/source_extra_info_card.dart';
import 'section/source_provider_card.dart';

class PublishDetailPage extends StatelessWidget {
  const PublishDetailPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        physics: ClampingScrollPhysics(),
        slivers: [
          SliverAppBar(
            iconTheme: IconThemeData(color: R.color.ffffffff),
            title: Text(
              "发布效果预览",
              style: TextStyle(color: R.color.ffffffff),
            ),
            pinned: true,
            expandedHeight: R.dimen.dp70,
            flexibleSpace: Image.asset(
              R.image.calenderBg,
              fit: BoxFit.fitWidth,
            ),
          ),
          SliverToBoxAdapter(
            child: Container(
              child: Stack(
                children: [
                  Image.asset(
                    R.image.calenderBg,
                    // fit: BoxFit.fitWidth,
                    width: R.dimen.width,
                    height: R.dimen.dp70,
                    fit: BoxFit.fill,
                  ),
                  Container(
                      margin: EdgeInsets.symmetric(horizontal: R.dimen.dp13),
                      child: SourceTopicCard())
                ],
              ),
            ),
          ),
          SliverToBoxAdapter(
            child: Container(
              margin: EdgeInsets.only(
                  left: R.dimen.dp13,
                  right: R.dimen.dp13,
                  top: R.dimen.dp20,
                  bottom: R.dimen.dp24),
              child: Row(
                children: [
                  Container(
                    margin: EdgeInsets.only(right: R.dimen.dp10),
                    child: ChimeraImage(
                        width: R.dimen.dp40,
                        height: R.dimen.dp40,
                        src:
                            "https://i.loli.net/2021/04/13/2VkqWFU5sxwSQcu.png"),
                  ),
                  Expanded(
                      child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Row(
                        children: [
                          Text(
                            "不会游泳的鱼",
                            style: TextStyle(fontSize: R.dimen.sp13),
                          ),
                          Container(
                            margin: EdgeInsets.only(
                                left: R.dimen.dp10, right: R.dimen.dp10),
                            child: Image.asset(R.image.realNameAuthed),
                          ),
                          Image.asset(R.image.jobTag)
                        ],
                      ),
                      Container(
                        child: Text(
                          "总经理 | 杭州叮咚网络科技有限公司",
                          style: TextStyle(
                              fontSize: R.dimen.sp11, color: R.color.ff999999),
                        ),
                      )
                    ],
                  ))
                ],
              ),
            ),
          ),
          SliverToBoxAdapter(
            child: Container(
                margin: EdgeInsets.symmetric(horizontal: R.dimen.dp13),
                child: AuthorContactCard()),
          ),
          SliverToBoxAdapter(
            child: Container(
                margin: EdgeInsets.symmetric(horizontal: R.dimen.dp13),
                child: SourceProviderCard()),
          ),
          SliverToBoxAdapter(
            child: Container(
                margin: EdgeInsets.symmetric(horizontal: R.dimen.dp13),
                child: SourceDemanderCard()),
          ),
          SliverToBoxAdapter(
            child: Container(
                margin: EdgeInsets.symmetric(horizontal: R.dimen.dp13),
                child: SourceDescriptionCard()),
          ),
          SliverToBoxAdapter(
            child: Container(
              margin: EdgeInsets.symmetric(horizontal: R.dimen.dp13),
              child: SourceExtraInfoCard(),
            ),
          ),
        ],
      ),
      bottomNavigationBar: Container(
        margin: EdgeInsets.only(
            left: R.dimen.dp15, right: R.dimen.dp15, bottom: R.dimen.dp13),
        child: ElevatedButton(onPressed: () {}, child: Text("发布")),
      ),
    );
  }
}
